#ifndef __TCP_SERVER_H__
#define __TCP_SERVER_H__

#include "acceptor.hpp"
#include "epoll_loop.hpp"

namespace  rocket
{
class tcp_server
{
public:
    tcp_server(int ,string) ;
    ~tcp_server() ;
    void turn_on();
    void turn_off();
    void set_callback(function<void(shared_ptr<tcp_link>)>callback_new,
        function<void(shared_ptr<tcp_link>)>callback_old,
        function<void(shared_ptr<tcp_link>)>callback_close);

private:
    acceptor _acceptor;
    epoll_loop _loop;
};

}

#endif